import {
  Controller,
  Get,
  Post,
  Body,
  Patch,
  Param,
  Delete,
  Query,
} from "@nestjs/common";
import { ConfigService } from "./config.service";
import { CreateConfigDto } from "./dto/create-config.dto";
import { QrCodeGenerator } from "@/utils/QR-code";
import { UpdateConfigDto } from "./dto/update-config.dto";

@Controller("config")
export class ConfigController {
  constructor(private readonly configService: ConfigService) {}

  @Get("config")
  config() {
    return this.configService.config();
  }

  /*
   * 生成二维码
   * */
  @Get("QRCode")
  QRCode(@Query() CreateConfigDto: CreateConfigDto) {
    return QrCodeGenerator.generateToBase64(CreateConfigDto.qrCode);
  }
}
